package com.xiyue.leaspring.datasourceTest;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.xiyue.leaspring.service.INewsService;

@ContextConfiguration(locations = {"classpath:spring/spring-jdbc9.xml"})
@RunWith(SpringJUnit4ClassRunner.class)//设置要测试的工具
public class DataSourceTest9 {
	
	private Logger logger = LoggerFactory.getLogger(DataSourceTest9.class);
	
	@Autowired
	private INewsService newsService;
		
	/**
	 * 通过主键查询
	 * @throws Exception
	 */
	@Test
	public void testFindById() throws Exception {
		
		this.logger.info(this.newsService.get(1L).toString());
		this.logger.info(this.newsService.get(1L).toString());
		
	}
}
